import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

/**
 * @Name: LogOn
 * @Description:
 * @Author: colfish
 * @Date: 2021/4/19
 */
public class LogOn extends JPanel {
    JLabel user = new JLabel("UserName：");
    JLabel password = new JLabel("Password：");
    JTextField userIn = new JTextField(10);
    JPasswordField passwordIn = new JPasswordField(10);
    JButton confirm = new JButton("continue");

    public LogOn() {
        add(user);
        add(password);
        add(userIn);
        add(passwordIn);
        add(confirm);
//        confirm.addActionListener(this);
        setLayout(null);
        user.setBounds(130, 80, 100, 30);
        password.setBounds(130, 120, 100, 30);
        userIn.setBounds(220, 85, 100, 20);
        passwordIn.setBounds(220, 125, 100, 20);
        confirm.setBounds(175, 180, 100, 25);
    }

    @Override
    public void print(Graphics g) {
        super.print(g);
    }

    public static void main(String[] args) {
        JFrame jFrame = new JFrame();
        jFrame.setBounds(0, 0, 400, 400);
        LogOn logOn = new LogOn();
        logOn.setVisible(true);
        logOn.setBounds(0, 0, 400, 400);
        jFrame.add(logOn);
        jFrame.pack();
        jFrame.setVisible(true);
        jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }
}